IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].GetUserEmailAddress') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].GetUserEmailAddress
GO

/******************************************************************
* Name:			GetUserEmailAddress
* Purpose:		Retrieves a user's email contact information
*
* PARAMETERS
* Name    				Description					
* -------------  		-------------------------------------------
* FwkDomainUserId				Person Id.	(REQUIRED)  
******************************************************************/

CREATE PROCEDURE [dbo].GetUserEmailAddress
(
		@FwkDomainUserId			INTEGER
)
AS
BEGIN

	SET NOCOUNT ON

	SELECT	EmailId, LastName + ' ' + FirstName + ' (' + Name + ')'as Name		
	FROM	WorkflowResources	
	WHERE	UserId = @FwkDomainUserId
	
END

GO

